package com.khadi.testcase.view.model;

public class IdValueModel<K, E> {
	K k;
	E e;

	public IdValueModel() {

	}

	public IdValueModel(K k, E e) {
		this.k = k;
		this.e = e;
	}

	public void setK(K k) {
		this.k = k;
	}

	public K getK() {
		return k;
	}

	public void setE(E e) {
		this.e = e;
	}

	public E getE() {
		return e;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((k == null) ? 0 : k.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		IdValueModel other = (IdValueModel) obj;
		if (k == null) {
			if (other.k != null)
				return false;
		} else if (!k.equals(other.k))
			return false;
		return true;
	}

	@Override
	public String toString() {

		return (String) getE();
	}

}
